package com.ruoyi.common.base.enums;



import com.ruoyi.common.base.vo.ComKeyValueVo;

import java.util.ArrayList;
import java.util.List;


/**
 * 时间类型枚举
 *
 * @author gu
 */
public enum DateTimeTypeEnum {
    YEAR("1", "年"),//100
    MONTH("2", "月"),//200
    DAY("3", "天"),//300
    HOUR("4", "小时"),//500
    MINUTE("5", "分钟");//500
    private final String code;
    private final String type;

    DateTimeTypeEnum(String code, String type) {
        this.code = code;
        this.type = type;
    }

    public static List<ComKeyValueVo> getDateTimeTypeEnumList() {
        ArrayList<ComKeyValueVo> dateTimeTypeEnumList = new ArrayList<>();
        for (DateTimeTypeEnum dateTimeTypeEnum : DateTimeTypeEnum.values()) {
            ComKeyValueVo dateTimeTypeEnumVo = new ComKeyValueVo();
            dateTimeTypeEnumVo.setKey(dateTimeTypeEnum.code);
            dateTimeTypeEnumVo.setValue(dateTimeTypeEnum.type);
            dateTimeTypeEnumList.add(dateTimeTypeEnumVo);
        }
        return dateTimeTypeEnumList;
    }

    public String getCode() {
        return code;
    }

    public String getType() {
        return type;
    }
}
